﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Controls_Mod_AddinManager_AddinManagerEdit : AddinManagerBase
{
    List<Message> list = new List<Message>();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //YOu must load model before load control
            Model = GetModel();
            LoadConfigToControl();

        }
    }

   

   
    protected override void OnInit(EventArgs e)
    {
        //CreateModuleOption();
        SaveTool1.SaveClick += new EventHandler(SaveTool1_SaveClick);
        SaveTool1.CancelClick += new EventHandler(SaveTool1_CancelClick);
        SaveTool1.ApplyClick += new EventHandler(SaveTool1_ApplyClick);
        base.OnInit(e);
    }

    void SaveTool1_ApplyClick(object sender, EventArgs e)
    {
        throw new NotImplementedException();
    }

    void SaveTool1_CancelClick(object sender, EventArgs e)
    {
        throw new NotImplementedException();
    }

    void SaveTool1_SaveClick(object sender, EventArgs e)
    {
        //Get data and Save using Transaction

        //Using transaction Decorator for code block

        try
        {
            ProcessModuleOptionResults(Action.EDIT);
            Response.Redirect(DoAction.ActionPageView(PageView.AddinManager, Action.LIST));
        }
        catch (Exception ex)
        {


            list.Add(new Message("Update Is fail!"));
            list.Add(new Message(ex.Message));
            ViewMessage(list, MessageType.Error);
        }


    }





}
